<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>动态库存管理</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../../../lib/layui-v2.5.5/css/layui.css" media="all">
		<link rel="stylesheet" href="../../../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
		<link rel="stylesheet" href="../../../css/public.css" media="all">
		<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
		<script src="../../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
		<script src="../../../lib/common/jquery.cookie.min.js" charset="utf-8"></script>
		<script src="../../../lib/common/common.js" charset="utf-8"></script>
	</head>
	<body>
		<div class="layuimini-container">
			<div class="layuimini-main">
				<!--搜索开始-->
				<fieldset class="layui-elem-field layuimini-search">
					<legend>搜索信息</legend>
					<div style="margin: 10px 10px 10px 10px">
						<form class="layui-form layui-form-pane" action="" id="searchFrm">
							<div class="layui-form-item">
								<div class="layui-inline">
									<label class="layui-form-label">库存单编号</label>
									<div class="layui-input-inline">
										<input type="text" name="storeId" autocomplete="off" class="layui-input">
									</div>
								</div>
								<label class="layui-form-label">I级分类名称</label>
								<div class="layui-input-inline">
									<select name="firstKindName" >
										<option value="" selected>请选择类型</option>
										<option value="电子">电子</option>
										<option value="机械">机械</option>
										</select>
								</div>
								
									<div class="layui-inline">
										<a class="layui-btn " lay-submit="" lay-filter="data-search-btn"><label class="layui-icon layui-icon-search"></label>搜索</a>
										<a class="layui-btn layui-btn-warm" onclick="javascript:$('#searchFrm')[0].reset()" lay-filter="data-search-btn"><label
											 class="layui-icon layui-icon-refresh"></label>重置</a>
									</div>
								</div>
						</form>
					</div>
				</fieldset>
				<!--搜索结束-->
				<table id="RepertoryCell" lay-filter="test"></table>
			</div>
		</div>


		<script type="text/javascript">
			layui.use(['table', 'jquery', 'form', 'laydate'], function() {
				var table = layui.table,
					layer = layui.layer,
					form = layui.form,
					$ = layui.jquery,
					laydate = layui.laydate;
				//第一个实例
				var tableIns = table.render({
					elem: '#RepertoryCell',
					url: api4 + 'repertoryCell/findRepertory' //数据接口
						,
					page: true //开启分页
						,
					cols: [
						[{
							field: 'storeId',
							title: '库存单编号',
							unresize: true,
							sort: true,
							align: "center"
						}, {
							field: 'productId',
							title: '产品编号',
							align: "center"
						}, {
							field: 'productName',
							title: '产品名称'
						}, {
							field: 'firstKindName',
							title: 'I级分类名称',
							align: "center"
						}, {
							field: 'secondKindName',
							title: 'II级分类名称',
							align: "center"
						}, {
							field: 'thirdKindName',
							title: 'III级分类名称',
							align: "center"
						}, {
							field: 'maxCapacityAmount',
							title: '库存最大储量',
							align: "center"
						}, {
							field: 'amount',
							title: '当前储量',
							align: "center"
						}]
					],
				});
				// 监听搜索操作
				form.on('submit(data-search-btn)', function(data) {
					var params = $("#searchFrm").serialize();
					//执行搜索重载
					table.reload('RepertoryCell', {
						page: {
							curr: 1
						},
						url: api4 + 'repertoryCell/findRepertory?' + params
					});
					return false;
				});

			});
		</script>
	</body>
</html>
